#!/usr/bin/env bash
set -e

[ ! -z "$SNABB_PCI_INTEL0" ] || exit 1
out=$(./snabb packetblaster replay --duration 1 \
    program/snabbnfv/test_fixtures/pcap/64.pcap \
    "$SNABB_PCI_INTEL0")
# Extract floating point Mpps number from output.
pps=$(echo "$out" | grep TXDGPC | cut -f 3 | sed s/,//g)
echo "scale=2; $pps / 1000000" | bc
